package rs.belex.belexdroid.beans;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

import rs.belex.belexdroid.beans.interfaces.ShareChange;

public class ShareChangeBean implements ShareChange {

	private static final long serialVersionUID = -4676125231101581798L;
	private Double changeValue;
	private Date time;
	private long timestamp;

	public ShareChangeBean() {
		super();
	}

	public Date getTime() {
		return this.time;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public Double getChangeValue() {
		return this.changeValue;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public void setChangeValue(Double changeValue) {
		this.changeValue = changeValue;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public String getFormatedDate() {
		SimpleDateFormat formatter = new SimpleDateFormat(
				"E, dd MMM yyyy HH:mm:ss");
		String time2 = (String) formatter.format(time);
		return time2;
	}

	public Double getRoundDouble() {
		BigDecimal bd = new BigDecimal(changeValue);
		bd = bd.setScale(0, BigDecimal.ROUND_HALF_UP);
		return bd.doubleValue();
	}

}
